<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>城市信息</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<jsp:include page="../../include.jsp"></jsp:include>
	<script type="text/javascript">
<%-- 		var path = "<%=path%>";
		$(function(){
			$('#tree').treeview({
	            data: getTree(),         
	            multiSelect: true
	        });
		});
		function getTree() {
			 var data = [];
	         $.ajax({
	        	 url : path+"/divisionController/getDivisionTree",
	        	 type : "post",
	        	 dataType : "json",
	        	 async : false,
	        	 success: function(datalist){
	        		 data = datalist;
	        	 }
	         });
				debugger;
	         return data;
	     } --%>
	     
/* 树形菜单 */	     
	        var path = "<%=path%>";
			var setting = {
					async: {
						enable: true,
						url: path+"/divisionController/getDivisionZTree",
						autoParam:["id", "name=n", "level=lv"],
						otherParam:{"otherParam":"zTreeAsyncTest"},
						dataFilter: filter
					},
					data: {
						simpleData: {
							enable: true
						}
					}
				};

				function filter(treeId, parentNode, childNodes) {
					if (!childNodes) return null;
					for (var i=0, l=childNodes.length; i<l; i++) {
						childNodes[i].name = childNodes[i].name.replace(/\.n/g, '.');
					}
					return childNodes;
				}
				
				$(document).ready(function(){
					$.fn.zTree.init($("#ztree"), setting);
				});

	</script>

  
  <body>
    <!-- <div id="tree"></div> -->
	<div>
		<ul id="ztree" class="ztree"></ul>
	</div>
  </body>
</html>
